<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="/static/component/pear/css/pear.css"/>
    <script src="/static/component/layui/layui.js"></script>
    <script src="/static/component/pear/pear.js"></script>
</head>
<body>
<form class="layui-form" action="">
    <div class="mainBox">
        <div class="main-container">
            <div class="layui-form-item">
                <label class="layui-form-label">
                    手机号
                </label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input layui-form-danger" name="mobile" type="text"
                           value="{$model['mobile']??""}"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    姓名
                </label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input layui-form-danger" name="username" type="text"
                           value="{$model['username']??""}"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    身份
                </label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input layui-form-danger" name="relationship" type="text"
                           value="{$model['relationship']??""}"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    客户意向
                </label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input layui-form-danger" name="intention" type="text"
                           value="{$model['intention']??""}"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    客户类型
                </label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input layui-form-danger" name="user_type" type="text"
                           value="{$model['user_type']??""}"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    住宅电话
                </label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input layui-form-danger" name="home_mobile" type="text"
                           value="{$model['home_mobile']??""}"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    居住地
                </label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input layui-form-danger" name="address" type="text"
                           value="{$model['address']??""}"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    居住地
                </label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input layui-form-danger" name="address_info" type="text"
                           value="{$model['address_info']??""}"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    成交价格
                </label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input layui-form-danger" name="deal_price" type="text"
                           value="{$model['deal_price']??""}"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    卡类型
                </label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input layui-form-danger" name="cart_type" type="text"
                           value="{$model['cart_type']??""}"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    收款方式
                </label>
                <div class="layui-input-block">
                    <select name="collection_type">
                        <option {if $model['collection_type']=='谷微'}selected{/if}>谷微</option>
                        <option {if $model['collection_type']=='谷支'}selected{/if}>谷支</option>
                        <option {if $model['collection_type']=='谷pos'}selected{/if}>谷pos</option>
                        <option {if $model['collection_type']=='谷青岛银行卡'}selected{/if}>谷青岛银行卡</option>
                        <option {if $model['collection_type']=='现金'}selected{/if}>现金</option>
                        <option {if $model['collection_type']=='基本户'}selected{/if}>基本户</option>
                        <option {if $model['collection_type']=='一般户（4008）'}selected{/if}>一般户（4008）</option>
                        <option {if $model['collection_type']=='一般户（青岛银行）'}selected{/if}>一般户（青岛银行）</option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    学生名称
                </label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input layui-form-danger" name="stu_name" type="text"
                           value="{$model['stu_name']??""}"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    校区名称
                </label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input layui-form-danger" name="sch_name" type="text"
                           value="{$model['sch_name']??""}"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    报名时间
                </label>
                <div class="layui-input-block">
                    <input type="date" class="layui-input layui-form-danger" name="reply_time" type="text"
                           value="{$model['reply_time']??""}"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    招生顾问
                </label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input layui-form-danger" name="recruit" type="text"
                           value="{$model['recruit']??""}"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    备注
                </label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input layui-form-danger" name="remarks" type="text"
                           value="{$model['remarks']??""}"/>
                </div>
            </div>
        </div>
    </div>
    <div class="bottom">
        <div class="button-container">
            <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit="" lay-filter="save">
                <i class="layui-icon layui-icon-ok"></i>
                提交
            </button>
            <button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">
                <i class="layui-icon layui-icon-refresh"></i>
                重置
            </button>
        </div>
    </div>
</form>
<script>
    layui.use(['form', 'jquery', 'layedit', 'uploads'], function () {
        let form = layui.form;
        let $ = layui.jquery;
        let layedit = layui.layedit
        layedit.set({
            uploadImage: {
                url: "{$Request.root}/index/upload"
            }
        });
        //建立编辑器

        form.on('submit(save)', function (data) {

            $.ajax({
                data: JSON.stringify(data.field),
                dataType: 'json',
                contentType: 'application/json',
                type: 'post',
                success: function (res) {
                    //判断有没有权限
                    if (res && res.code == 999) {
                        layer.msg(res.msg, {
                            icon: 5,
                            time: 2000,
                        })
                        return false;
                    } else if (res.code == 200) {
                        layer.msg(res.msg, {icon: 1, time: 1000}, function () {
                            parent.layer.close(parent.layer.getFrameIndex(window.name));//关闭当前页
                            parent.layui.table.reload("dataTable");
                        });
                    } else {
                        layer.msg(res.msg, {icon: 2, time: 1000});
                    }
                }
            })
            return false;
        });
    })
</script>
</body>
</html>